# Makefile

OCAML=ocamlc
OCAMLFLAGS= -w s -w f -w y -I +lablgtk2 -I +sdl -I +lablGL
OCAMLLD= lablgtk.cma gtkInit.cmo bigarray.cma sdl.cma sdlloader.cma lablgl.cma lablgtkgl.cma graphics.cma

ML=parse.ml testgl.ml detourn.ml quad.ml makeobj.ml delaunS.ml quadtree.ml saidalex.ml param.ml proj.ml

.SUFFIXES: .ml .cmo

CMO=${ML:.ml=.cmo}

all:${CMO}
	${OCAML} ${OCAMLFLAGS} ${OCAMLLD} ${CMO} -o MAP

mli:${CMO}
	make all
	${OCAML} ${OCAMLFLAGS} ${OCAMLLD} -i parse.ml > parse.mli
	${OCAML} ${OCAMLFLAGS} ${OCAMLLD} -i testgl.ml > testgl.mli
	${OCAML} ${OCAMLFLAGS} ${OCAMLLD} -i detourn.ml > detourn.mli
	${OCAML} ${OCAMLFLAGS} ${OCAMLLD} -i quad.ml > quad.mli
	${OCAML} ${OCAMLFLAGS} ${OCAMLLD} -i makeobj.ml > makeobj.mli
	${OCAML} ${OCAMLFLAGS} ${OCAMLLD} -i delaunS.ml > delaunS.mli
	${OCAML} ${OCAMLFLAGS} ${OCAMLLD} -i quadtree.ml > quadtree.mli
	${OCAML} ${OCAMLFLAGS} ${OCAMLLD} -i saidalex.ml > saidalex.mli
	${OCAML} ${OCAMLFLAGS} ${OCAMLLD} -i param.ml > param.mli
	${OCAML} ${OCAMLFLAGS} ${OCAMLLD} -i proj.ml > proj.mli
	rm *.cm? MAP


.ml.cmo:
	${OCAML} ${OCAMLFLAGS} ${OCAMLLD} -c $<

distclean:
	rm -f *.txt *.bmp *~ *.cm* .*mli

clean::
	rm -f *.txt *.bmp *~ *.o* *.cm*  *.mli MAP


# FIN
